Skip to content

fix(server): parse git branches correctly when column.ui is enabled#1529

Merged
juliusmarminge merged 3 commits intopingdotgg:mainfrom
EDM115:edm115/fix-git-column
Apr 1, 2026
Merged

fix(server): parse git branches correctly when column.ui is enabled#1529
juliusmarminge merged 3 commits intopingdotgg:mainfrom
EDM115:edm115/fix-git-column

Conversation

@EDM115
Copy link
Copy Markdown
Contributor

@EDM115 EDM115 commented Mar 29, 2026

What Changed

Added the --no-column flag to git operations that support it (git branch only here, if you ever need to parse git tag/status/clean at some point, you'll need to add that too).
Reference : https://git-scm.com/docs/git-column

Why

Users (like myself) can have the setting column.ui set to always in their .gitconfig (for better readability), but this messes up with the branch parsing in t3code.

As you can see here, branches are put here "as-is", even tho they should be in separated lines.
Currently it parses go-bin copilot/rewrite-cli-in-rust as one branch while they are two separate ones. The --no-column flag fixes that :

UI Changes

None.

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for any UI changes
  • I included a video for animation/interaction changes

Note

Medium Risk
Changes git branch invocations to add --no-column, which could affect behavior on older Git versions or in environments where the flag is unsupported, but is otherwise a narrow parsing fix.

Overview
Fixes branch name parsing in GitCore when a user has column.ui=always by forcing git branch output to be one-branch-per-line.

Updates listBranches (local and --remotes) and listLocalBranchNames to pass --no-column, and adds a regression test that reproduces multi-column git branch output and asserts branch names are not concatenated.

Written by Cursor Bugbot for commit 8fdae98. This will update automatically on new commits. Configure here.

Note

Fix git branch parsing when column.ui is enabled by passing --no-column

When column.ui is set to always in git config, git branch outputs multiple branch names per line, breaking line-by-line parsing. Adds --no-column to all git branch invocations in GitCore.ts (listBranches and listLocalBranchNames) to force one-branch-per-line output regardless of git configuration.

Macroscope summarized 8fdae98.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 29, 2026

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: a680f1e5-b29f-4598-b7e3-f4cbb5376343

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions bot added size:XS 0-9 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list. labels Mar 29, 2026
- Add coverage for `git branch` parsing when `column.ui=always`
- Prevent merged branch names when Git formats output into columns
- Update the GitCore integration test to match the `branch --no-column` invocation
- Covers the remote-branches failure path with the corrected command shape
@juliusmarminge juliusmarminge merged commit 19eb9e7 into pingdotgg:main Apr 1, 2026
11 checks passed
@EDM115
Copy link
Copy Markdown
Contributor Author

EDM115 commented Apr 1, 2026

thanks Julius for adding the tests 🫡 I admit I should have done that myself

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS 0-9 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants